CREATE TABLE [dbo].[T_CYTOLOGY]
(
[CYTOLOGY_ID] [bigint] NOT NULL IDENTITY(1, 1),
[CITOLOGY_CODE] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CUSTOMER_ID] [bigint] NULL,
[PRODUCT_ID] [bigint] NULL,
[MEDICAL_CENTER_ID] [bigint] NULL,
[CYTOLOGY_DOCTOR_ID] [bigint] NULL,
[CYTOLOGY_SAMPLING_DATE] [datetime] NOT NULL,
[CYTOLOGY_SHIPPING_DATE] [datetime] NOT NULL,
[PREGNANCY] [int] NULL,
[CHILDBIRTH] [int] NULL,
[ABORTION] [int] NULL,
[CESAREAN] [int] NULL,
[IVSA] [int] NULL,
[FUR] [datetime] NULL,
[ACTUAL_PREGNANCY] [int] NULL,
[WEEK_OF_PREGNANCY] [int] NULL,
[IS_SMOKE] [bit] NULL,
[PRIOR_SURGERY_ID] [bigint] NULL,
[CONTRACEPTIVE] [bit] NULL,
[CONTRACEPTIVE_METHOD_ID] [bigint] NULL,
[CONTRACEPTIVE_INITIAL_DATE] [date] NULL,
[PRIOR_PAP] [bit] NULL,
[PRIOR_PAPA_DATE] [date] NULL,
[PRIOR_PAPA_RESULT] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PROC_EXOENNDOCERVIX] [bit] NULL,
[PROC_VAGINA] [bit] NULL,
[PROC_CUPULA] [bit] NULL,
[PROC_OTHER] [bit] NULL,
[NORMAL_ASPECT] [bit] NULL,
[INFLAMED_ASPECT] [bit] NULL,
[ATROPHY_ASPECT] [bit] NULL,
[TUMORAL_ASPECT] [bit] NULL,
[NORMAL_SECRETION] [bit] NULL,
[LEUCORREA_SECRETION] [bit] NULL,
[BLEEDING_SECRETION] [bit] NULL,
[PURULENTA_SECRETION] [bit] NULL,
[CITOLOGY_COMMENT] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[T_CYTOLOGY] ADD CONSTRAINT [PK__T_CYTOLO__27F26AEC84419331] PRIMARY KEY CLUSTERED  ([CYTOLOGY_ID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[T_CYTOLOGY] ADD CONSTRAINT [FK__T_CYTOLOG__CONTR__57DD0BE4] FOREIGN KEY ([CONTRACEPTIVE_METHOD_ID]) REFERENCES [dbo].[T_CONTRACEPTIVE_METHOD] ([CONTRACEPTIVE_METHOD_ID])
GO
ALTER TABLE [dbo].[T_CYTOLOGY] ADD CONSTRAINT [FK__T_CYTOLOG__CUSTO__531856C7] FOREIGN KEY ([CUSTOMER_ID]) REFERENCES [dbo].[T_CUSTOMER] ([CUSTOMER_ID])
GO
ALTER TABLE [dbo].[T_CYTOLOGY] ADD CONSTRAINT [FK__T_CYTOLOG__CYTOL__55F4C372] FOREIGN KEY ([CYTOLOGY_DOCTOR_ID]) REFERENCES [dbo].[T_DOCTOR] ([DOCTOR_ID])
GO
ALTER TABLE [dbo].[T_CYTOLOGY] ADD CONSTRAINT [FK__T_CYTOLOG__MEDIC__55009F39] FOREIGN KEY ([MEDICAL_CENTER_ID]) REFERENCES [dbo].[T_MEDICAL_CENTER] ([MEDICAL_CENTER_ID])
GO
ALTER TABLE [dbo].[T_CYTOLOGY] ADD CONSTRAINT [FK__T_CYTOLOG__PRIOR__56E8E7AB] FOREIGN KEY ([PRIOR_SURGERY_ID]) REFERENCES [dbo].[T_SURGERY] ([SURGERY_ID])
GO
ALTER TABLE [dbo].[T_CYTOLOGY] ADD CONSTRAINT [FK__T_CYTOLOG__PRODU__540C7B00] FOREIGN KEY ([PRODUCT_ID]) REFERENCES [dbo].[T_PRODUCT] ([PRODUCT_ID])
GO
